package cn.wolfcode.shop.domain;

import java.util.HashMap;

import com.alibaba.fastjson.JSON;

import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class Catalog extends BaseDomain {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String name;

	private String code;

	private Integer sort;

	private Long pId;

	private Byte isParent;
	
	private Integer propertyCount;
	
	private Integer productCount;

	public String getJsonData() {
		
		HashMap<String, Object> map = new HashMap<>();
		map.put("id", this.getId());
		map.put("name", this.name);
		map.put("code", this.code);
		map.put("sort", this.sort);
		map.put("pId", this.pId);
		map.put("isParent", this.isParent);
		
		return JSON.toJSONString(map);
	}

}